//package com.booter.ws.config;
//
//import com.google.gson.GsonBuilder;
//import io.searchbox.client.JestClient;
//import io.searchbox.client.JestClientFactory;
//import io.searchbox.client.config.HttpClientConfig;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//@Configuration
//public class JestClientConfig {
//
//    @Value("${spring.elasticsearch.uris}")
//    private String uris;
//    @Value("${spring.elasticsearch.username}")
//    private String username;
//    @Value("${spring.elasticsearch.password}")
//    private String password;
//
//
//    @Bean(destroyMethod = "close")
//    public JestClient jestClient() {
//        JestClientFactory factory = new JestClientFactory();
//        factory.setHttpClientConfig(
//                new HttpClientConfig.Builder(uris)
//                        .multiThreaded(true)
//                        .defaultCredentials(username, password)
//                        .defaultMaxTotalConnectionPerRoute(100)
//                        .maxTotalConnection(100).readTimeout(10_000).connTimeout(3_000)
//                        .gson(new GsonBuilder().create())
//                        .build());
//        return factory.getObject();
//    }
//
//}
